{{useCss "app-pages/css/main.scss",(["/main.html","/"]) }}
<div class="logoinfo">
    <img src="http://7jpte7.com1.z0.glb.clouddn.com/Fm86nr3kXSplg2K0N3w5p1CX1jTW" />
    <div class="main_search_box">
        <input type="text" placeholder="请输入关键字搜索" />
        <div class="icon-search"></div>
    </div>
</div>
<div class="imgbox" id="box">
    <mobile_picwall array-data-key="bus_info.config.home_imgs"></mobile_picwall>
</div>

<div class="main_menu_box">
    <href to="/goods_list.html?id=3">
        <div class="item">
            <div class="icon-gift"></div>
            商品
        </div>
    </href>
    <href to="/classify.html">
        <div class="item">
            <div class="icon-th"></div>
            分类
        </div>
    </href>
   <!--  <href to="/tickets.html">
        <div class="item">
            <div class="icon-bookmark-empty"></div>
            优惠券
        </div>
    </href> -->
    <a>
        <div class="item" event-click="{{'$Event.top.jumpToCart'}}">
            <div class="icon-basket"></div>
            购物车
        </div>
    </a>
    {{#if !loginer}}
    <href to="/sign_in.html">
        <div class="item">
            <div class="icon-user"></div>
            登陆
        </div>
    </href>
    {{/if}}
    {{#if loginer.card_list.length}}
    <href to="/membercircle.html">
        <div class="item">
            <div class="icon-user"></div>
            Vip专场
        </div>
    </href>
    {{/if}}
</div>
<div class="classify_box">
    <div class="title">
        <div class="line"></div>
        精品荟萃
        <div class="line"></div>
    </div>
    <div class="title_i">每一种选择，都是别具匠心的精品</div>
    <div class="box">
        <div class="box_a">
            <href to="/classify_goods_list.html?id=CL_ffa661215003d3d108">
                <img src="http://7jpte7.com1.z0.glb.clouddn.com/FjdKQFJ3JmKGh3Iqoi7AOHF8e0oC">
            </href>
            <div class="name">钻石</div>
        </div>
        <div class="box_b">
            <div class="item">
                <href to="/classify_goods_list.html?id=CL_6d30fb5215003ddfa80">
                    <img src="http://7jpte7.com1.z0.glb.clouddn.com/FjehZFLeLnRNRzc5i0YLpOfJSX5K">
                </href>
                <div class="name">翡翠&玉石</div>
            </div>
            <div class="item">
                <href to="/classify_goods_list.html?id=CL_0b4c662d15089333156">
                    <img src="http://7jpte7.com1.z0.glb.clouddn.com/FrqPUNkRU8RF-lah3hqI1Kv23UDX">
                </href>
                <div class="name">黄金</div>
            </div>
        </div>
        <div class="box_c">
            <div class="item">
                <href to="/classify_goods_list.html?id=CL_4c1fed0e15089337d18">
                    <img src="http://7jpte7.com1.z0.glb.clouddn.com/FsL488VpE7xmLDXMl52hX9dq4wK4">
                </href>
                <div class="name">铂金</div>
            </div>
            <div class="item">
                <href to="/classify_goods_list.html?id=CL_d94c47b615089355dbd">
                    <img src="http://7jpte7.com1.z0.glb.clouddn.com/FrVGpTQck5JyMoY-Q7iHQam8be71">
                </href>
                <div class="name">天然晶石</div>
            </div>
            <div class="item">
                <href to="/classify_goods_list.html?id=CL_871255c51508d3c7fd7">
                    <img src="http://7jpte7.com1.z0.glb.clouddn.com/FuR9GyRLSd42cDB3m8XffWRSlvn8">
                </href>
                <div class="name">文玩</div>
            </div>
        </div>
    </div>
</div>
<div class="typetitle">
    <div class="line"></div>
    倾情推荐
    <div class="line"></div>
</div>
<!-- goods -->
<div class="_main_goods">
    {{#each $Cache.main.goods_list}}
        {{#> "jewel-mobile-main-goods"}}
    {{/each}}
</div>


{{#if !$Cache.main.loading_tags_completed}}
<div class="icon-spin4 animate-spin">正在加载</div>
{{#else}}
<!-- tag goods -->
{{#each $Cache.main.classify_list}}
    {{#if contents.length}}
    <div class="typetitle">
        <div class="line"></div>
        {{title}}
        <div class="line"></div>
        <href to="/classify_goods_list.html?id={{_id}}" class="tag_more">更多</href>
    </div>
    <div class="_main_goods">
        {{#each contents}}
            {{#> "jewel-mobile-main-goods","$This",6 > $Index}}
        {{/each}}
    </div>
    {{/if}}
{{/each}}
{{/if}}

<div class="_main_bottom">
    <href to="goods_list.html?id=3">点此查看更多商品</href>
</div>

{{#if $Cache.main.store_list.length}}
<div class="store_list">
    {{#each $Cache.main.store_list}}
    <href class="item" to="/store_preview.html?geotable_id={{uid}}">
        <div class="img">
            <img bind-src="{{logo_url}}?imageView/1/w/200/h/120/q/100">
        </div>
        <div class="store_title">
            {{title}}
        </div>
    </href>
    {{/each}}
</div>
{{/if}}

<xmp type="tag" name="mobile_picwall">
    <div class="picwall">
        <div class="carosule">
            <div class="pic-show">
            {{#if ${array-data-key}.length }}
                {{#each ${array-data-key} }}
                <div style="z-index:{{$Parent.length-$Index}}" class="pic">
                    <href target="_blank" bind-to="{{href||'javascript:void 0'}}">
                        <img bind-src="{{img_url}}?imageView/1/w/500/h/350/q/95" />
                    </href>
                </div>
                {{/each}}
            {{#else}}
                <div style="z-index:{{$Parent.length-$Index}}" class="pic">
                    <href target="_blank" bind-to="{{href||'javascript:void 0'}}">
                        <img bind-src="/images/default_bg.jpg" />
                    </href>
                </div>
            {{/if}}
            </div>
        </div>
    </div>
    <script type="text/vm">
        function(vm) {
            var picwall = vm.queryElement({
                className: 'picwall'
            })[0];
            var img = vm.queryElement({
                tagName: "IMG"
            });
            require(["jQuery"], function($) {
                var $picwall = $(picwall);
                var i = 0;
                var w = $picwall.width();
                var h = w * 0.7;
                $picwall.height(h);
                var current_pic;
                var pics = $picwall.find(".pic");
                var len = $(pics).length;
                console.log(len);   
                var timer = setInterval(function _() {
                    $(pics[(i - 1) % len]).stop().fadeOut(1000);
                    $(pics[i % len]).stop().fadeIn(1000);
                    i += 1;
                    return _;
                }(), 5000);
            });
        }
    </script>
</xmp>

<xmp type="template" name="jewel-mobile-main-goods">
    <div class="maingoods">
        <div class="img">
            <href to="goods_details.html?id={{_id}}" class="imgbox">
                <img bind-src="{{preview_img_url}}?imageView/1/h/330/w/330" />
            </href>
        </div>
        <div class="info">
            <div class="intro">
                {{goods_name}}　{{intro}}
            </div>
            <div class="price">￥{{card_cash_map[$Top.loginer.current_card_factory_id]||cash}}</div>
            <del>{{original_price?"￥"+original_price:""}}</del>
        </div>
    </div>
</xmp>
